package com.baba.client.service.impl;

import com.baba.client.dao.ClientHistoryDao;
import com.baba.client.dao.ClientUserDao;
import com.baba.client.entity.ClientHistory;
import com.baba.client.entity.ClientUser;
import com.baba.client.entity.vo.PageVo;
import com.baba.client.service.ClientHistoryService;
import com.baba.client.service.ClientUserService;
import com.baba.client.utils.retruns.ResponseResult;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.C;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestParam;

import javax.annotation.Resource;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by cengyujun on 2020/6/12 11:48 上午
 */
@Slf4j
@Service
@Transactional
public class ClientHistoryServiceImpl extends ServiceImpl<ClientHistoryDao, ClientHistory> implements ClientHistoryService {
    @Autowired
    private ClientHistoryService clientHistoryService;
    @Resource
    ClientHistoryDao    clientHistoryDao;

    public ResponseResult queryAll(@RequestParam(defaultValue = "1") int pageNo, @RequestParam(defaultValue = "15")  int pageSize, @RequestParam(required = false) String placeName)throws IOException {
         try{
             Map<String,Object>data=new HashMap<>();
             List<ClientHistory> list =clientHistoryDao.selectList(null);
              data.put("list",list);
              log.info("list>>>>>>>>>>>."+list);
             return ResponseResult.success(data);
         }catch (Exception e){
             e.printStackTrace();
         }
        //需要在Config配置类中配置分页插件
//        IPage<ClientHistory> page = new Page<>();
//        page.setCurrent(5); //当前页
//        page.setSize(1);    //每页条数
//        page = clientHistoryService.page(page);e
return null;

    }

}
